<template>
	<view>
		<view class="edgeInsetTop"></view>
		<view class="cu-list menu sm-border">
			<view class="cu-item" style="min-height:200rpx;" @tap="$wanlshop.auth(`/pages/user2/partner/storeinfo?data=${JSON.stringify(store)}`)">
				<view class="cu-avatar round lg margin-right"  :style="{backgroundImage: 'url('+ $wanlshop.oss(store.image, 52, 52, 2, 'avatar') +')'}"></view> 
				<view class="content" style="line-height: 1.5em;"> 
					<view class="text-lg">
						{{store.store}}
					</view>
					<view class="wanl-grey text-df">
						联系人：{{store.truename}}
					</view>
				</view>
				<view class="action">
					<text class="wlIcon-jifen"></text>
					<text class="margin-lr-xs">编辑</text>
					<text class="wlIcon-fanhui2"></text>
				</view>
			</view>
			<view class="cu-item arrow" @tap="$wanlshop.auth(`/pages/user2/partner/worker?id=${store.id}`)">
				<view class="content">
					<text>店员授权设置</text>
				</view>
			</view>
		</view>
		<view class="cu-list menu sm-border margin-top">
			<view class="cu-item arrow" @tap="$wanlshop.auth(`/pages/user2/partner/store/stores?id=${store.id}`)">
				<view class="content">
					<text>下级门店授权设置</text>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				fileSizeString: '0 B',
				store:{}
			}
		},
		onLoad(option) {
			// #ifdef APP-PLUS
			this.formatSize();
			// #endif
			this.store = JSON.parse(option.data);
			console.log(this.store);
		},
		methods: {
			formatSize() {  
                plus.cache.calculate((size)=> {  
                    let sizeCache = parseInt(size);  
                    if (sizeCache == 0) {  
                        this.fileSizeString = "0 B";  
                    } else if (sizeCache < 1024) {  
                        this.fileSizeString = sizeCache + " B";  
                    } else if (sizeCache < 1048576) {  
                        this.fileSizeString = (sizeCache / 1024).toFixed(2) + " KB";  
                    } else if (sizeCache < 1073741824) {  
                        this.fileSizeString = (sizeCache / 1048576).toFixed(2) + " MB";  
                    } else {  
                        this.fileSizeString = (sizeCache / 1073741824).toFixed(2) + " GB";  
                    }  
                }); 
            }
			
		}
	}
</script>

<style>

</style>
